<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>正则表达式</title>
	<script>
		//检测"数字"是否为正整数
		var n = '123';
		var bool = /^[1-9]\d*$/.test(n);
		console.log(bool);
	</script>
</head>
<body>
	
</body>
</html>